package interface_demo;

import java.util.ArrayList;

public class ClassManager {
    private ArrayList<Student> students = new ArrayList<>();
    private StudentOperator studentOperator = new StudentOperatorImpl1(); // 只需改变成StudentOperatorImpl2就可以更换方案

    public ClassManager() {
        students.add(new Student("瓜皮1", '女', 90));
        students.add(new Student("瓜皮2", '女', 91));
        students.add(new Student("瓜皮3", '男', 92));
        students.add(new Student("瓜皮4", '男', 93));
    }

    // 打印全班全部学生的信息
    public void printInfo() {
        studentOperator.printAllInfo(students);
    }

    // 打印全班全部学生的平均分
    public void printScore() {
        studentOperator.printAverageScore(students);
    }
}
